package org.rjxh.examfront.comtroller;

import org.rjxh.examfront.pojo.R;
import org.rjxh.examfront.service.IExamRecordService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/record")
public class RecordController {

    @Resource
    private IExamRecordService examRecordService;

    @GetMapping("/getRecordListByExamID")
    public R getRecordListByExamID(@RequestParam Long examID) {
        if (examID == null){
            return new R(400,"参数错误");
        }
        return examRecordService.selectExamRankingsByExamId(examID);
    }

    @GetMapping("/getRecordDetailByRecordId")
    public R getRecordDetailByRecordId(@RequestParam Long recordId) {
        return examRecordService.selectRecordDetailByRecordId(recordId);
    }



}
